package com.gc.services.impl;

import com.gc.dao.custom.DeviceRecordMapper;
import com.gc.pojo.SysDeviceRecord;
import com.gc.services.DeviceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xyl
 * @create 2020/8/7 17:13
 * @desc 设备记录操作
**/
@Service
public class DeviceRecordServiceImpl implements DeviceRecordService {
    @Autowired
    private DeviceRecordMapper deviceRecordMapper;
    @Override
    public List<SysDeviceRecord> getMyDeviceRecord(Integer uid) {
        return deviceRecordMapper.selectRecordByUId(uid);
    }

    @Override
    public Integer addDeviceRecord(SysDeviceRecord record) {
        return deviceRecordMapper.insertSelective(record);
    }

    @Override
    public SysDeviceRecord getDeviceRecordByVid(Integer vid) {
        return deviceRecordMapper.selectByPrimaryKey(vid);
    }
}
